package com.fac.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 设备分类表
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("equipment_category")
@ApiModel(description = "设备分类实体类")
public class EquipmentCategory implements Serializable {

    /**
     * 分类ID
     */
    @TableId(value = "category_id", type = IdType.AUTO)
    @ApiModelProperty(value = "分类ID", example = "1")
    private Long categoryId;

    /**
     * 父分类ID
     */
    @ApiModelProperty(value = "父分类ID", example = "0", notes = "顶级分类的父ID为0")
    private Long parentId;

    /**
     * 编码
     */
    @ApiModelProperty(value = "分类编码", example = "CAT001", required = true)
    private String code;

    /**
     * 名称
     */
    @ApiModelProperty(value = "分类名称", example = "加工设备", required = true)
    private String name;

    /**
     * 级别
     */
    @ApiModelProperty(value = "分类级别", example = "1", notes = "1为一级分类，2为二级分类，以此类推")
    private Integer level;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序值", example = "1", notes = "数值越小越靠前")
    private Integer sort;

    /**
     * 状态：0禁用，1启用
     */
    @ApiModelProperty(value = "状态：1启用，0禁用", example = "1")
    private Integer status;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", example = "2024-01-01 12:00:00")
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间", example = "2024-01-01 12:00:00")
    private LocalDateTime updatedAt;

    @TableField(exist = false)
    @ApiModelProperty(value = "父分类名称", example = "设备分类")
    private String parentName;
}
